﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WqLunTan.Controllers;
using WqLunTan.Extensions;
using WqLunTan.Models;
using WqLunTan.Models.DataBase;

namespace WqLunTan.Reply
{
    /// <summary>
    /// 扫码二维码
    /// </summary>
    public class ScanReply : IReply
    {
        public string reply(wechat_data data)
        {
            var sb = new StringBuilder();
            sb.Append($"欢迎关注公众号,你可以发送消息留言,\r\n但是请在留言内容中注明联系方式,\r\n也可以访问我的网站,\r\n{WxApiController.CurrentDomain}");

            return $"<xml><ToUserName><![CDATA[{data.FromUserName}]]></ToUserName><FromUserName><![CDATA[{data.ToUserName}]]></FromUserName><CreateTime>{DateTimeOffset.UtcNow.ToUnixLong()}</CreateTime><MsgType><![CDATA[{MsgType.text.ToString()}]]></MsgType><Content><![CDATA[{sb.ToString()}]]></Content></xml>";
        }
    }
}
